﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;

namespace _009
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Hashtable ht = new Hashtable();

            ht.Add("001", "小王");
            ht.Add("002", "小黄");
            ht.Add("003", "小李");
            if(ht.ContainsValue("张三"))
            {
                Console.WriteLine("该学生姓名已存在");
            }
            else
            {
                ht.Add("004", "李四");
            }
            //获取键的集合
            ICollection key = ht.Keys;
            foreach(string k in key)
            {
                Console.WriteLine(k + ":" + ht[k]);
            }
            Console.ReadKey();
        }
    }
}
